<html>
<title>test</title>
<body bgcolor="Silver">
  <video id='video1' src="test.webm" controls></video>
  <script>
    var video = document.getElementById('video1');
    var mediaElement = video;

    video.oncanplaythrough = function() {
        document.title = 'ready_to_play';
    }

    video.onended = function(e) {
        document.title = 'ended';
    }

    function playvideo() {
      mediaElement.play();
    }

    mediaElement.load();
  </script>
  <button id="button1" onclick="playvideo()">Click me</button>
</body>
</html>
